package top.huntwolf.admin.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import top.huntwolf.admin.common.JsonResult;
import top.huntwolf.admin.pojo.BookReserve;
import top.huntwolf.admin.service.BookReserveService;

import java.util.List;

@Api(description = "书本商品信息控制类")
@RestController
@CrossOrigin
@RequestMapping(value = "/reserve")
public class BookReserveController {

    @Autowired
    private BookReserveService reserveService;

//    @GetMapping("/{condition}")
//    public JsonResult<BookReserve> query(@PathVariable String condition) {
//
//        BookReserve bookCondition = reserveService.select(condition);
//        return JsonResult.success(bookCondition);
//    }

    @RequiresPermissions(value = "reserve:modify")
    @PutMapping()
    public JsonResult update(@RequestBody BookReserve bookCondition){
        reserveService.update(bookCondition);
        return JsonResult.success(null);
    }

//    @GetMapping("")
//    @ApiOperation("查询全部")
//    public JsonResult<List<BookReserve>> queryAll() {
//
//        List<BookReserve> bookCondition = reserveService.selectAll();
//        return JsonResult.success(bookCondition);
//    }
//
//    @DeleteMapping("/{condition}")
//    public JsonResult delete(@PathVariable String condition){
//        reserveService.delete(condition);
//        return JsonResult.success(null);
//    }
//
//    @PostMapping("")
//    public JsonResult add(BookReserve bookCondition){
//        reserveService.insert(bookCondition);
//        return JsonResult.success(null);
//    }

}
